Skip to content

Upgrade mammoth to 1.13 - #2647

Closed
Patrick Creighton (patrick-5546) wants to merge 1 commit into
microsoft:mainfrom
patrick-5546:deps/mammoth-1.13
Closed

Patrick Creighton (patrick-5546) wants to merge 1 commit into
microsoft:mainfrom
patrick-5546:deps/mammoth-1.13

Conversation

@patrick-5546

Copy link
Copy Markdown

Fixes #2646.

Like #1452, this bumps mammoth~=1.11.0 to mammoth~=1.13.0 in the docx and all extras. From mammoth's NEWS:

  • 1.12.0: handles hyperlinked wp:anchor and wp:inline elements, and hyperlink fields with unquoted hrefs.
  • 1.12.1: ignores numbering levels whose numStyleLink refers to themselves. It also fixes a Windows-only --output-dir issue in mammoth's own CLI.
  • 1.12.2: field separators and ends without a matching start no longer raise IndexError, and unterminated strings in crafted documents no longer cause excessive backtracking.
  • 1.13.0: reads w:customXml content, handles moved paragraphs and runs tracked as revisions, and improves escaping in mammoth's Markdown writer, which MarkItDown doesn't use.

This adds a regression test for unmatched field marks. It fails with mammoth 1.11.0 and passes with 1.13.0.

Checks:

  • packages/markitdown: 1098 passed, 11 skipped.
  • markitdown-ocr: 108 passed.
  • markitdown-mcp: 21 passed.
  • black 23.7.0: clean.

mammoth 1.12.2 handles complex field separators and ends without a
matching start, which raised IndexError ("pop from empty list") and
failed the whole DOCX conversion. It also avoids excessive backtracking
when parsing unterminated strings in crafted documents. 1.12.0 and 1.13.0
add hyperlinked images, unquoted HYPERLINK hrefs, w:customXml content,
and moved paragraphs tracked as revisions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOCX conversion fails with IndexError on unmatched field marks; fixed in mammoth 1.12.2, but MarkItDown pins mammoth~=1.11.0

1 participant